package com.itwang.common;

import java.util.LinkedHashSet;


//比较两个LinkedHashSet是否相同
public class CmpLinkedHashSetIps {
	//相同为true,不同为false
	public static boolean cmp(LinkedHashSet<String> oldIps, LinkedHashSet<String> newIps) {
		if (oldIps == newIps){
			return true;
		}
		if (oldIps.size() != newIps.size()) {
			return false;
		}else {
			for (String oldIp : oldIps) {
				if (!newIps.contains(oldIp)) {
					return false;
				}
			}
		}
		
		return true;
	}
}
